package com.wzk.travelspringboot.controller;

import com.wzk.travelspringboot.dto.Result;
import com.wzk.travelspringboot.dto.ScenicCommentDTO;
import com.wzk.travelspringboot.service.ScenicCommentService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: WangZiKang
 * @Date: 2025/1/12 20:05
 */
@Slf4j
@RestController
@RequestMapping("/scenic/comment")
@RequiredArgsConstructor
@Validated
public class ScenicCommentController {

    private final ScenicCommentService scenicCommentService;

    @PostMapping
    public Result comment(@RequestBody ScenicCommentDTO dto){
        return scenicCommentService.comment(dto);
    }

    @GetMapping("/all/{id}")
    public Result getCommentAllByScenicId(@PathVariable(name = "id") String id){
        return scenicCommentService.allCommentById(id);
    }


}
